package com.skyline.energy.datasource;

import javax.sql.DataSource;

import com.skyline.energy.dataaccess.jdbc.JdbcTransactionContext;
import com.skyline.energy.transaction.TransactionContextHolder;

public abstract class DistributeDataSource extends DelegateDataSource {

	protected DataSource getTxDataSource() {
		JdbcTransactionContext txContext = (JdbcTransactionContext) TransactionContextHolder.getContext();
		return txContext == null ? null : txContext.getTxDataSource();
	}

}
